home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 3.2 KB | 111 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWBndShp.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWBNDSHP_H
- #define FWBNDSHP_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class ODTransform;
-
- //========================================================================================
- // class FW_CBoundedShape
- //========================================================================================
-
- class FW_CBoundedShape : public FW_CShape
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_CBoundedShape)
- virtual ~ FW_CBoundedShape(); // autodest destructors must be public
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- protected:
- FW_CBoundedShape(const FW_CRect& rect,
- FW_ERenderVerbs renderVerb,
- const FW_CInk& ink,
- const FW_CStyle& style,
- const FW_CFont& font);
-
- FW_CBoundedShape(const FW_CBoundedShape& other);
- FW_CBoundedShape(FW_CReadableStream& stream);
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CBoundedShape& operator=(const FW_CBoundedShape& other);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- //----- Hit Test -----
- FW_Boolean HitTest(FW_CGraphicContext& gc,
- const FW_CPoint& test,
- FW_Fixed tolerance) const;
-
- // ----- Transform -----
- virtual void Transform(Environment *ev, ODTransform* transform);
- virtual void InverseTransform(Environment *ev, ODTransform* transform);
-
- virtual void MoveShape(FW_Fixed deltaX, FW_Fixed deltaY);
- virtual void MoveShapeTo(FW_Fixed x, FW_Fixed y);
-
- virtual void Inset(FW_Fixed h, FW_Fixed v);
-
- // ----- Bounds -----
- virtual void GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
-
- // ----- Anchor Point -----
- virtual FW_CPoint GetAnchorPoint() const;
-
- // ----- Persistence -----
- virtual void Flatten(FW_CWritableStream& stream) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void GetRectangle(FW_CRect& rect) const
- {rect = fRect;}
-
- void SetRectangle(const FW_CRect& rect)
- {fRect = rect;}
-
- void SetRectangle(FW_Fixed left, FW_Fixed top, FW_Fixed right, FW_Fixed bottom)
- {fRect.Set(left, top, right, bottom);}
-
- void SetRectangle(const FW_CPoint& topLeft, const FW_CPoint& botRight)
- {fRect.Set(topLeft.x, topLeft.y, botRight.x, botRight.y);}
-
- void SetRectangle(const FW_CPoint& topLeft, FW_Fixed width, FW_Fixed height)
- {fRect.Set(topLeft, width, height);}
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- FW_CRect fRect;
- };
-
- #endif
-